CREATE TRIGGER TGTL_01 ON THELOAI
INSTEAD OF DELETE
AS
BEGIN
	DECLARE @MATL VARCHAR(15)
	SET @MATL = (SELECT MATHELOAI FROM deleted)
	DELETE FROM SachTheLoai WHERE MaTheLoai = @MATL
	DELETE FROM TheLoai WHERE MaTheLoai = @MATL
	RAISERROR('XOA THE LOAI THANH CONG',16,1)
END